vulkan: Don't emit library_arch if the library_path is just a basename
authorSimon McVittie <smcv@collabora.com>
Thu, 11 Sep 2025 19:15:25 +0000 (20:15 +0100)
committerTimo Aaltonen <tjaalton@debian.org>
Wed, 7 Jan 2026 12:26:39 +0000 (14:26 +0200)
If the library_path is just a basename like `libvulkan_lvp.so`, then
we can share the same JSON manifest between all of the architectures,
like we already do for Vulkan layers. This is also how the Nvidia
proprietary driver works, and how Mesa is packaged in Debian 13.
However, this will only work if we don't mark the manifest as being
architecture-specific.

This partially reverts commit f7aa6ba9 "vulkan: Specify library_arch in
ICD files".

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37314>
Applied-upstream: 26.0, commit:1ec7bc382d13f01371a4255004b2fd4f545739a9

Gbp-Pq: Name vulkan-Don-t-emit-library_arch-if-the-library_path-is-jus.patch

src/vulkan/util/vk_icd_gen.py

index 15adf5f6d8acb1361fc401fdbd3d336e75b16b8d..7760dd6b0475fedd9dec0d668d7ddb30fb5c8741 100644 (file)
@@ -75,7 +75,7 @@ if __name__ == '__main__':
         },
     }
 
-    if args.sizeof_pointer:
+    if args.sizeof_pointer and ('/' in lib_path or '\\' in lib_path):
         bit_width = args.sizeof_pointer * 8
         if bit_width in [32, 64]:
             json_data['ICD']['library_arch'] = str(bit_width)